const {
  override,
  addWebpackAlias,
  disableEsLint,
  addDecoratorsLegacy
} = require("customize-cra");

const path = require("path");

if (process.env.NODE_ENV === "production") {
  process.env.GENERATE_SOURCEMAP = "false";
}

module.exports = override(
  // enable legacy decorators babel plugin
  addDecoratorsLegacy(),
  // disable eslint in webpack
  disableEsLint(),
  addWebpackAlias({
    "@": path.join(__dirname, "./src"),
  }),
  (config) => {
    if (process.env.NODE_ENV === "production") {
      config.devtool = false;
    }
    return config
  }
)



